package cn.edu.scau.cmi.duzefeng.factory.model;
import cn.edu.scau.cmi.duzefeng.factory.insurance.CarDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.insurance.DriversDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.insurance.Insurance;
import cn.edu.scau.cmi.duzefeng.factory.insurance.MultiDamageInsurance;
import cn.edu.scau.cmi.duzefeng.factory.insurance.SomebodyDieSimpleInsurance;

public abstract class InsuranceSimpleFactory {
	private InsuranceSimpleFactory(){
		
	}
	public static enum InsuranceType{
		CarDamage , DriversDamage, MultiDamage, SomebodyDie 
	}
	public static Insurance create(InsuranceType type) {
		Insurance insurance = null;
		switch (type) {
		case CarDamage:
			insurance = new CarDamageInsurance();
			break;
		case DriversDamage:
			insurance = new DriversDamageInsurance();
			break;
		case MultiDamage:
			insurance = new MultiDamageInsurance();
			break;
		case SomebodyDie:
			insurance = new SomebodyDieSimpleInsurance();
		default:
			break;
		}
		return insurance;
	}
}
